package cn.zyjblogs.server.user.vo;

import cn.zyjblogs.starter.common.entity.constant.CommonConstant;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author zhuyijun
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(description = "用户vo类")
public class UserVo implements Serializable {

    @ApiModelProperty(value = "主键id")
    private String id;

    @ApiModelProperty(value = "账号（用户名）")
    @NotBlank(message = "账号不能为空")
    private String username;

    @ApiModelProperty(value = "姓名")
    private String name;
    @ApiModelProperty(value = "年龄")
    private Integer age;
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "邮箱")
    private String email;
    @ApiModelProperty(value = "状态")
    private Integer status;
    @ApiModelProperty(value = "logo")
    private String avatar;
    @ApiModelProperty(value = "邀请人")
    private String inviteUserId;
    @ApiModelProperty(value = "是否删除 0未删除")
    private Integer deleted;
    @ApiModelProperty(value = "备注")
    private String description;
    @ApiModelProperty(value = "创建人")
    private String createUserId;

    @ApiModelProperty(value = "创建时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JSONField(format = CommonConstant.DATETIME_PATTERN)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "编辑人")
    private String editUserId;

    @ApiModelProperty(value = "编辑时间")
    @JSONField(format = CommonConstant.DATETIME_PATTERN)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime editTime;

    @ApiModelProperty(value = "租户id")
    private String tenantId;
}
